//
//  SPHomeCommandTableViewCell.m
//  ShopProject
//
//  Created by 颜魏 on 2018/11/27.
//  Copyright © 2018年 KB. All rights reserved.
//

#import "SPHomeCommandTableViewCell.h"
#import "SPProductModel.h"

@interface SPHomeCommandTableViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *iconIv;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;

@end

@implementation SPHomeCommandTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.numberLabel.layer.masksToBounds = YES;
    self.numberLabel.layer.cornerRadius = 3;
}

#pragma mark - get set
- (void)setProduct:(SPProductModel *)product {
    _product = product;
    [self.iconIv yy_setImageWithURL:[NSURL URLWithString:product.productIconUrl] placeholder:kProductPlaceholderIconImage];
    self.titleLabel.text = product.productName;
    self.descLabel.text = product.productDesc;
    self.priceLabel.text = [NSString stringWithFormat:@"￥%@", product.productPrice];
    self.numberLabel.text = [NSString stringWithFormat:@"  已有%@人购买  ", product.productSellerCount];
}


@end
